
public class Punct2D {
protected double x;
protected double y;


public Punct2D (double x, double y)
{
	super();
	this.x=x;
	this.y=y;
	
}
public Punct2D()
{
	super();
}
public double getX() {
	return x;
}
public void setX(double x) {
	this.x = x;
}
public double getY() {
	return y;
}
public void setY(double y) {
	this.y = y;
}
public double Distanta (Punct2D a){
	double D=Math.sqrt(Math.pow((a.getX()- this.getX()),2.0))+(Math.pow((a.getY() - this.getY()),2.0));
    return D;
}
public static void main(String args[])
{
	Punct2D p1, p2;
    p1= new Punct2D (2,3);
    p2= new Punct2D (1,2);
	   
	    double dist= p1.Distanta(p2);
	    System.out.println("distanta este:" + dist);
	}

	




}

